import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router';
import MenuView from '../views/MenuView.vue';
import { Router } from '@icon-park/vue-next';

const my_createRouter = () =>
  createRouter({
    history: createWebHashHistory(import.meta.env.BASE_URL),
    routes: [
      {
        path: '/',
        name: 'home',
        meta: {
          title: '首页',
        },
        component: MenuView,
      },
      {
        path: '/menu',
        name: 'menu',
        meta: {
          title: '首页',
        },
        component: MenuView,
      },
      {
        path: '/setting',
        name: 'setting',
        component: () => import('../views/SettingView.vue'),
      },
      {
        path: '/login',
        name: 'login',
        component: () => import('../views/LoginView.vue'),
      },
      {
        path: '/stockin',
        name: 'stockin',
        meta: {
          title: '入库',
        },
        component: () => import('../views/StockInView.vue'),
      },
      {
        path: '/info',
        name: 'info',
        meta: {
          title: '个人信息',
        },
        component: () => import('../views/InfoView.vue'),
      },
      {
        path: '/placelist',
        name: 'placelist',
        meta: {
          title: '库位清单',
          hide_back: true,
        },
        component: () => import('../views/PlaceListView.vue'),
      },
      {
        path: '/place',
        name: 'place',
        meta: {
          title: '查库位',
        },
        component: () => import('../views/PlaceView.vue'),
      },
      {
        path: '/placeedit',
        name: 'placeedit',
        meta: {
          title: '建库位',
        },
        component: () => import('../views/PlaceEditView.vue'),
      },
      {
        path: '/stocklist',
        name: 'stocklist',
        meta: {
          title: '查记录',
        },
        component: () => import('../views/StockListView.vue'),
      },
      {
        path: '/stockdetail',
        name: 'stockdetail',
        meta: {
          title: '查明细',
        },
        component: () => import('../views/StockDetailView.vue'),
      },
      {
        path: '/stockhistory',
        name: 'stockhistory',
        meta: {
          title: '出库历史',
        },
        component: () => import('../views/StockHistoryView.vue'),
      },
    ],
  });
const router = my_createRouter();

export default router;
